package com.ly.fn.modules.insure.service;

import com.ly.fn.core.common.service.BaseService;
import com.ly.fn.core.exception.ServiceException;
import com.ly.fn.modules.insure.dao.InsureOrderDao;
import com.ly.fn.modules.insure.entity.InsureOrder;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

/**
 * Created by wb38113 on 2016/8/16.
 */
@Service("insureOrderService")
public class InsureOrderService extends BaseService {

    @Resource(name = "insureOrderDao")
    private InsureOrderDao insureOrderDao;

    @Transactional(readOnly = false)
    public InsureOrder save(InsureOrder insureOrder){
        try {
            insureOrder = insureOrderDao.save(insureOrder);
        } catch (Exception e) {
            throw new ServiceException("保存投保订单异常",e);
        }
        return insureOrder;
    }
}
